<?php
App::uses('AppController', 'Controller');
/**
 * GalleryController
 */
class GalleryController extends AppController {

    public $uses = array('Gallery', 'Article');

/**
 * Components
 *
 * @var array
 */
	public $components = array('Paginator');
    public $paginate = array(
        'limit' => 20,
        'order' => array(
            'Gallery.gallery_id' => 'DESC'
        )
    );
/**
 * index method
 *
 * @return void
 */
	public function index() {
		$this->Gallery->recursive = -1;
        $this->Paginator->settings = $this->paginate;
		$this->set('galleries', $this->Paginator->paginate('Gallery'));
		
		$this->Article->recursive = -1;
        $cond = array('conditions' => array('category_id' => 1), 'order' => 'created_date DESC', 'limit' => 4);
        $this->set('articleLastest', $this->Article->find('all', $cond));
	}
    
}
